package com.abing.starry.spi.quote;

import cn.hutool.core.util.RandomUtil;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * @Author CaptainBing
 * @Date 2024/9/19 15:54
 * @Description
 */
public class FamousQuoteManager {

    protected static final List<String> FAMOUS_QUOTES = new ArrayList<>();


    public void register(String quote){
        if (Objects.isNull(quote)) {
            return;
        }
        FAMOUS_QUOTES.add(quote);
    }

    public String getRandomQuote(){
        return FAMOUS_QUOTES.get(RandomUtil.randomInt(0, FAMOUS_QUOTES.size()));
    }

    public List<String> getAllQuotes(){
        return FAMOUS_QUOTES;
    }

}
